
import {useParams,useLocation} from 'react-router-dom'
import qs from 'querystring'

export default (props)=>{

    console.log(props)
     //rest风格
    //let {id,stuName} = useParams();
    //查询字符串
    //let {stuid,stuname} = qs.parse(useLocation().search.slice(1));
     //state传值
     let {stuid,stuname} = useLocation().state;
    return(
        <>
        <div>users(用户页面)</div>
        <h1>获得参数</h1>
         <h2>参数:编号为：{stuid} --姓名：{stuname}</h2>
        </>
    )
}